package com.study.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ContextStartedEventListener  implements ApplicationListener<ApplicationStartedEvent> {
    @Override
    public void onApplicationEvent(ApplicationStartedEvent contextStartedEvent) {
        if (null == contextStartedEvent.getApplicationContext().getParent()) {
            log.info("----------------------ContextStartedEvent:" + System.currentTimeMillis());
        }
    }
}
